package com.tedu.servies;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tedu.mapper.CartItemMapper;
//import com.tedu.mapper.CateMapper;
import com.tedu.pojo.Cate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 购物车服务
 */
@Service
public class CateServices {
    @Autowired
    CartItemMapper mapper;
    public List<Cate> getListByUserId(int id) {

        System.out.println(id);
        QueryWrapper wrapper = Wrappers.query();
        //用户id
        wrapper.eq("user_id",id);

        List<Cate> cates = mapper.selectList(wrapper);
        System.out.println("ddddd");
        System.out.println(cates);

        return cates;
    }
}
